﻿using IconYuan.Manager.DB;
using IconYuan.Model.DB;
using IconYuan.Model.Entity.Articles;
using IconYuan.Model.Entity.Markets;
using IconYuan.Model.Entity.Orders;
using SqlSugar;
using System;
using System.Linq.Expressions;

namespace IconYuan.Manager.Articles
{
    /// <summary>
    /// 内容管理
    /// </summary>
    public class ArticleManager : BaseContext<Article>
    {
        public async Task<List<ArticleBase>> GetListAsync(int store_id, int category_id)
        {
            return await Db.Queryable<ArticleBase>()
                .Where(x => x.store_id == store_id)
                .WhereIF(category_id > 0, x => x.category_id == category_id)
                .OrderBy("sort asc")
            .ToListAsync();
        }

       
    }
}
